<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>Dashboard - Ace Admin</title>

    <meta name="description" content="overview &amp; stats"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="/static/assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/static/assets/font-awesome/4.5.0/css/font-awesome.min.css"/>

    <!-- page specific plugin styles -->

    <!-- text fonts -->
    <link rel="stylesheet" href="/static/assets/css/fonts.googleapis.com.css"/>

    <!-- ace styles -->
    <link rel="stylesheet" href="/static/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style"/>

    <!--[if lte IE 9]>
			<link rel="stylesheet" href="/static/assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
    <link rel="stylesheet" href="/static/assets/css/ace-skins.min.css"/>
    <link rel="stylesheet" href="/static/assets/css/ace-rtl.min.css"/>

    <!--[if lte IE 9]>
		  <link rel="stylesheet" href="/static/assets/css/ace-ie.min.css" />
		<![endif]-->

    <!-- inline styles related to this page -->

    <!-- ace settings handler -->
    <script src="/static/assets/js/ace-extra.min.js"></script>

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
		<script src="/static/assets/js/html5shiv.min.js"></script>
		<script src="/static/assets/js/respond.min.js"></script>
		<![endif]-->
</head>

<body class="no-skin">
<div id="navbar" class="navbar navbar-default          ace-save-state">
    <div class="navbar-container ace-save-state" id="navbar-container">
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only">Toggle sidebar显示侧边栏</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>
        </button>

        <div class="navbar-header pull-left">
            <a href="index.html" class="navbar-brand">
                <small>
                    <i class="fa fa-leaf"></i>
                    汉语言分析系统
                </small>
            </a>
        </div>

        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                {#						<li class="grey dropdown-modal">#}
                {#							<a data-toggle="dropdown" class="dropdown-toggle" href="#">#}
                {#								<i class="ace-icon fa fa-tasks"></i>#}
                {#								<span class="badge badge-grey">4</span>#}
                {#							</a>#}
                {##}
                {#							<ul class="dropdown-menu-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close">#}
                {#								<li class="dropdown-header">#}
                {#									<i class="ace-icon fa fa-check"></i>#}
                {#									4 每日任务 #}
                {#								</li>#}
                {##}
                {#								<li class="dropdown-content">#}
                {#									<ul class="dropdown-menu dropdown-navbar">#}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">生字浏览记忆</span>#}
                {#													<span class="pull-right">65%</span>#}
                {#												</div>#}
                {##}
                {#												<div class="progress progress-mini">#}
                {#													<div style="width:65%" class="progress-bar"></div>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">生字顺序测试</span>#}
                {#													<span class="pull-right">35%</span>#}
                {#												</div>#}
                {##}
                {#												<div class="progress progress-mini">#}
                {#													<div style="width:35%" class="progress-bar progress-bar-danger"></div>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">生字随机测试</span>#}
                {#													<span class="pull-right">15%</span>#}
                {#												</div>#}
                {##}
                {#												<div class="progress progress-mini">#}
                {#													<div style="width:15%" class="progress-bar progress-bar-warning"></div>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">生字辨析测试</span>#}
                {#													<span class="pull-right">90%</span>#}
                {#												</div>#}
                {##}
                {#												<div class="progress progress-mini progress-striped active">#}
                {#													<div style="width:90%" class="progress-bar progress-bar-success"></div>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {#									</ul>#}
                {#								</li>#}
                {##}
                {#								<li class="dropdown-footer">#}
                {#									<a href="#">#}
                {#										任务细节#}
                {#										<i class="ace-icon fa fa-arrow-right"></i>#}
                {#									</a>#}
                {#								</li>#}
                {#							</ul>#}
                {#						</li>#}
                {##}
                {#						<li class="purple dropdown-modal">#}
                {#							<a data-toggle="dropdown" class="dropdown-toggle" href="#">#}
                {#								<i class="ace-icon fa fa-bell icon-animated-bell"></i>#}
                {#								<span class="badge badge-important">8</span>#}
                {#							</a>#}
                {##}
                {#							<ul class="dropdown-menu-right dropdown-navbar navbar-pink dropdown-menu dropdown-caret dropdown-close">#}
                {#								<li class="dropdown-header">#}
                {#									<i class="ace-icon fa fa-exclamation-triangle"></i>#}
                {#									8 Notifications#}
                {#								</li>#}
                {##}
                {#								<li class="dropdown-content">#}
                {#									<ul class="dropdown-menu dropdown-navbar navbar-pink">#}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">#}
                {#														<i class="btn btn-xs no-hover btn-pink fa fa-comment"></i>#}
                {#														你有未读的系统消息#}
                {#													</span>#}
                {#													<span class="pull-right badge badge-info">+12</span>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<i class="btn btn-xs btn-primary fa fa-arrow-circle-right"></i>#}
                {#												你有即将过期的背生词扩展包#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">#}
                {#														<i class="btn btn-xs no-hover btn-success fa fa-shopping-cart"></i>#}
                {#														新订单#}
                {#													</span>#}
                {#													<span class="pull-right badge badge-success">+8</span>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#">#}
                {#												<div class="clearfix">#}
                {#													<span class="pull-left">#}
                {#														<i class="btn btn-xs no-hover btn-info fa fa-plus"></i>#}
                {#                                                        关注#}
                {#													</span>#}
                {#													<span class="pull-right badge badge-info">+11</span>#}
                {#												</div>#}
                {#											</a>#}
                {#										</li>#}
                {#									</ul>#}
                {#								</li>#}
                {##}
                {#								<li class="dropdown-footer">#}
                {#									<a href="#">#}
                {#										显示全部通知#}
                {#										<i class="ace-icon fa fa-arrow-right"></i>#}
                {#									</a>#}
                {#								</li>#}
                {#							</ul>#}
                {#						</li>#}
                {##}
                {#						<li class="green dropdown-modal">#}
                {#							<a data-toggle="dropdown" class="dropdown-toggle" href="#">#}
                {#								<i class="ace-icon fa fa-envelope icon-animated-vertical"></i>#}
                {#								<span class="badge badge-success">5</span>#}
                {#							</a>#}
                {##}
                {#							<ul class="dropdown-menu-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close">#}
                {#								<li class="dropdown-header">#}
                {#									<i class="ace-icon fa fa-envelope-o"></i>#}
                {#									5 信息#}
                {#								</li>#}
                {##}
                {#								<li class="dropdown-content">#}
                {#									<ul class="dropdown-menu dropdown-navbar">#}
                {#										<li>#}
                {#											<a href="#" class="clearfix">#}
                {#												<img src="/static/assets/images/avatars/avatar.png" class="msg-photo" alt="Alex's Avatar" />#}
                {#												<span class="msg-body">#}
                {#													<span class="msg-title">#}
                {#														<span class="blue">A同学:</span>#}
                {#														B同学是一个很自律的人 ...#}
                {#													</span>#}
                {##}
                {#													<span class="msg-time">#}
                {#														<i class="ace-icon fa fa-clock-o"></i>#}
                {#														<span>刚刚</span>#}
                {#													</span>#}
                {#												</span>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#" class="clearfix">#}
                {#												<img src="/static/assets/images/avatars/avatar3.png" class="msg-photo" alt="Susan's Avatar" />#}
                {#												<span class="msg-body">#}
                {#													<span class="msg-title">#}
                {#														<span class="blue">Susan:</span>#}
                {#														毕业设计好烦 ...#}
                {#													</span>#}
                {##}
                {#													<span class="msg-time">#}
                {#														<i class="ace-icon fa fa-clock-o"></i>#}
                {#														<span>20分钟前</span>#}
                {#													</span>#}
                {#												</span>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#" class="clearfix">#}
                {#												<img src="/static/assets/images/avatars/avatar4.png" class="msg-photo" alt="Bob's Avatar" />#}
                {#												<span class="msg-body">#}
                {#													<span class="msg-title">#}
                {#														<span class="blue">Bob:</span>#}
                {#														受不了了，这么多生词 ...#}
                {#													</span>#}
                {##}
                {#													<span class="msg-time">#}
                {#														<i class="ace-icon fa fa-clock-o"></i>#}
                {#														<span>下午3:15</span>#}
                {#													</span>#}
                {#												</span>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#" class="clearfix">#}
                {#												<img src="/static/assets/images/avatars/avatar2.png" class="msg-photo" alt="Kate's Avatar" />#}
                {#												<span class="msg-body">#}
                {#													<span class="msg-title">#}
                {#														<span class="blue">Kate:</span>#}
                {#														有趣的灵魂万里挑一 ...#}
                {#													</span>#}
                {##}
                {#													<span class="msg-time">#}
                {#														<i class="ace-icon fa fa-clock-o"></i>#}
                {#														<span>下午1:30</span>#}
                {#													</span>#}
                {#												</span>#}
                {#											</a>#}
                {#										</li>#}
                {##}
                {#										<li>#}
                {#											<a href="#" class="clearfix">#}
                {#												<img src="/static/assets/images/avatars/avatar5.png" class="msg-photo" alt="Fred's Avatar" />#}
                {#												<span class="msg-body">#}
                {#													<span class="msg-title">#}
                {#														<span class="blue">Fred:</span>#}
                {#														    不拿群众一针一线...#}
                {#													</span>#}
                {##}
                {#													<span class="msg-time">#}
                {#														<i class="ace-icon fa fa-clock-o"></i>#}
                {#														<span>上午10:09</span>#}
                {#													</span>#}
                {#												</span>#}
                {#											</a>#}
                {#										</li>#}
                {#									</ul>#}
                {#								</li>#}
                {##}
                {#								<li class="dropdown-footer">#}
                {#									<a href="inbox.html">#}
                {#										显示全部信息#}
                {#										<i class="ace-icon fa fa-arrow-right"></i>#}
                {#									</a>#}
                {#								</li>#}
                {#							</ul>#}
                {#						</li>#}

                <li class="light-blue dropdown-modal">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="/static/assets/images/avatars/user.jpg" alt="Jason's Photo"/>
                        <span class="user-info">
									<small>欢迎,</small>
									{{ request.session.username }}
								</span>

                        <i class="ace-icon fa fa-caret-down"></i>
                    </a>

                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
{% comment %}                        <li>
                            <a href="#">
                                <i class="ace-icon fa fa-cog"></i>
                                设置
                            </a>
                        </li>

                        <li>
                            <a href="profile.html">
                                <i class="ace-icon fa fa-user"></i>
                                简况
                            </a>
                        </li>

                        <li class="divider"></li>{% endcomment %}

                        <li>
                            <a href="logout">
                                <i class="ace-icon fa fa-power-off"></i>
                                退出
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div><!-- /.navbar-container -->
</div>

<div class="main-container ace-save-state" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.loadState('main-container')
        } catch (e) {
        }
    </script>

    <div id="sidebar" class="sidebar                  responsive                    ace-save-state">
        <script type="text/javascript">
            try {
                ace.settings.loadState('sidebar')
            } catch (e) {
            }
        </script>

        {#				<div class="sidebar-shortcuts" id="sidebar-shortcuts">#}
        {#					<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">#}
        {#						<button class="btn btn-success">#}
        {#							<i class="ace-icon fa fa-signal"></i>#}
        {#						</button>#}
        {##}
        {#						<button class="btn btn-info">#}
        {#							<i class="ace-icon fa fa-pencil"></i>#}
        {#						</button>#}
        {##}
        {#						<button class="btn btn-warning">#}
        {#							<i class="ace-icon fa fa-users"></i>#}
        {#						</button>#}
        {##}
        {#						<button class="btn btn-danger">#}
        {#							<i class="ace-icon fa fa-cogs"></i>#}
        {#						</button>#}
        {#					</div>#}
        {##}
        {#					<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">#}
        {#						<span class="btn btn-success"></span>#}
        {##}
        {#						<span class="btn btn-info"></span>#}
        {##}
        {#						<span class="btn btn-warning"></span>#}
        {##}
        {#						<span class="btn btn-danger"></span>#}
        {#					</div>#}
        {#				</div><!-- /.sidebar-shortcuts -->#}

        <ul class="nav nav-list">
            <li class="active">
                <a href="index">
                    <i class="menu-icon fa fa-tachometer"></i>
                    <span class="menu-text"> CCAS </span>
                </a>

                <b class="arrow"></b>
            </li>

            <li class="">
                <a href="index" class="">
                    <i class="menu-icon fa fa-desktop"></i>
                    <span class="menu-text">
								首页
							</span>

                    <b class="arrow fa fa-home"></b>
                </a>

            </li>
            <li>
                <a href="./learningLibrary" class="">
                    <i class="menu-icon fa fa-book" aria-hidden="true"></i>
                    <span class="menu-text">
                                生词库
                            </span>
                    <b class="arrow fa fa-minus"></b>
                </a>
            </li>
            <li class="">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-font"></i>
                    <span class="menu-text"> 生字测试 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li class="">
                        <a href="./testLibrary">
                            <i class="menu-icon fa fa-caret-right"></i>
                            初级测试
                        </a>

                        <b class="arrow"></b>
                    </li>

                    <li class="">
                        <a href="./testMiddleLibrary">
                            <i class="menu-icon fa fa-caret-right"></i>
                            中级测试
                        </a>

                        <b class="arrow"></b>
                    </li>
                    <li class="">
                        <a href="./testHighLibrary">
                            <i class="menu-icon fa fa-caret-right"></i>
                            高级测试
                        </a>

                        <b class="arrow"></b>
                    </li>
                </ul>
            </li>

            <li class="">
                <a href="./testResult" class="">
                    <i class="menu-icon fa fa-file-text"></i>
                    <span class="mnue-text">成绩档案</span>
                    <b class="arrow fa fa-minus"></b>
                </a>
            </li>
        </ul>

        <!-- /.nav-list -->

        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state"
               data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>
    </div>

    <div class="main-content">
        <div class="main-content-inner">

            <div class="page-content">
                <div class="ace-settings-container" id="ace-settings-container">
                    <div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
                        <i class="ace-icon fa fa-cog bigger-130"></i>
                    </div>

                    <div class="ace-settings-box clearfix" id="ace-settings-box">
                        <div class="pull-left width-50">
                            <div class="ace-settings-item">
                                <div class="pull-left">
                                    <select id="skin-colorpicker" class="hide">
                                        <option data-skin="no-skin" value="#438EB9">#438EB9</option>
                                        <option data-skin="skin-1" value="#222A2D">#222A2D</option>
                                        <option data-skin="skin-2" value="#C6487E">#C6487E</option>
                                        <option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
                                    </select>
                                </div>
                                <span>&nbsp; Choose Skin</span>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2 ace-save-state"
                                       id="ace-settings-navbar" autocomplete="off"/>
                                <label class="lbl" for="ace-settings-navbar"> Fixed Navbar</label>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2 ace-save-state"
                                       id="ace-settings-sidebar" autocomplete="off"/>
                                <label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2 ace-save-state"
                                       id="ace-settings-breadcrumbs" autocomplete="off"/>
                                <label class="lbl" for="ace-settings-breadcrumbs"> Fixed Breadcrumbs</label>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl"
                                       autocomplete="off"/>
                                <label class="lbl" for="ace-settings-rtl"> Right To Left (rtl)</label>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2 ace-save-state"
                                       id="ace-settings-add-container" autocomplete="off"/>
                                <label class="lbl" for="ace-settings-add-container">
                                    Inside
                                    <b>.container</b>
                                </label>
                            </div>
                        </div><!-- /.pull-left -->

                        <div class="pull-left width-50">
                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover"
                                       autocomplete="off"/>
                                <label class="lbl" for="ace-settings-hover"> Submenu on Hover</label>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact"
                                       autocomplete="off"/>
                                <label class="lbl" for="ace-settings-compact"> Compact Sidebar</label>
                            </div>

                            <div class="ace-settings-item">
                                <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight"
                                       autocomplete="off"/>
                                <label class="lbl" for="ace-settings-highlight"> Alt. Active Item</label>
                            </div>
                        </div><!-- /.pull-left -->
                    </div><!-- /.ace-settings-box -->
                </div><!-- /.ace-settings-container -->

                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->

                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">高级测试</h3>

                                <div class="form-check">
                                    <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                        <tbody>
                                        {% for story in zd %}
                                            <tr>
                                                <td colspan="4" count="{{ forloop.counter }}">
                                                    {{ forloop.counter }}、请选择汉字[{{ story.zi }}]的拼音：
                                                    <span class="right"
                                                          style="display: none">（正确答案是{{ story.py }}）</span>
                                                </td>
                                            </tr>
                                            <tr>
                                                {% for story2 in story.cw %}
                                                    {% if forloop.counter == story.zq %}
                                                        <td width="200px" zq="{{ story.py }}">
                                                            <input type="radio" value="{{ story.py }}" class="result"
                                                                   name="pinying{{ story.id }}"
                                                            />{{ story.py }}
                                                        </td>
                                                    {% else %}
                                                        <td width="200px" zq="{{ story.py }}">
                                                            <input type="radio" value="{{ story2.py }}" class="result"
                                                                   name="pinying{{ story.id }}"
                                                            />{{ story2.py }}
                                                        </td>
                                                    {% endif %}
                                                {% endfor %}
                                            </tr>
                                        {% endfor %}
                                        </tbody>
                                        <tr>
                                            <td colspan="4" style="text-align: center; background-color:lightblue;">
                                                <button id="okSucess" type="submit" value="Submit">提交</button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4" style="text-align: center">本次测试总共10道题，总分是100分，每道题10分</td>
                                        </tr>
                                    </table>
                                </div>

                            </div>
                        </div>

                    </div><!-- /.modal-dialog -->
                </div>


                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
</div>
</div><!-- /.main-content -->

<div class="footer">
    <div class="footer-inner">
        <div class="footer-content">
                                <span class="bigger-120">
                                    <span class="blue bolder">汉语言</span>
                                    分析系统 &copy; 2018-2019
                                </span>

        </div>
    </div>
</div>

<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div><!-- /.main-container -->

<script src="/static/assets/js/jquery-2.1.4.min.js"></script>

<!-- <![endif]-->

<!--[if IE]>
<script src="/static/assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='/static/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="/static/assets/js/bootstrap.min.js"></script>

<!-- page specific plugin scripts -->
<script src="/static/assets/js/jquery.dataTables.min.js"></script>
<script src="/static/assets/js/jquery.dataTables.bootstrap.min.js"></script>
<script src="/static/assets/js/dataTables.buttons.min.js"></script>
<script src="/static/assets/js/buttons.flash.min.js"></script>
<script src="/static/assets/js/buttons.html5.min.js"></script>
<script src="/static/assets/js/buttons.print.min.js"></script>
<script src="/static/assets/js/buttons.colVis.min.js"></script>
<script src="/static/assets/js/dataTables.select.min.js"></script>

<!-- ace scripts -->
<script src="/static/assets/js/ace-elements.min.js"></script>
<script src="/static/assets/js/ace.min.js"></script>

<!-- inline scripts related to this page -->
<script type="text/javascript">
    var begintimestamp = Date.parse(new Date());
    jQuery(function ($) {
        //测试完成提交
        $('#okSucess').on('click', function (e) {
            $(":checkbox, :radio").attr("disabled", true);
            $(".right").show();
            var tinum = 0;
            var right = 0;
            $('#dynamic-table').find("tbody").find("tr").each(function () {
                if ($(this).find('td').length > 2) {
                    tinum = tinum + 1;
                    var right_e = $($(this).find('td')[0]).attr("zq");
                    {#console.log('right_name',radio_name);#}
                    var choose = $(this).find("input:checked").val();
                    // console.log('right_name_checked:', choose);
                    if (right_e == choose) {
                        right = right + 1;
                    }
                }
            });
            var timestamp = Date.parse(new Date());
            {#var endtimestamp = getNowFormatDate();#}
            $.ajax({
                url: '/user/postData',
                type: 'POST',
                data: {
                    name: "{{ request.session.username }}",
                    testType: "high",
                    begintimestamp: begintimestamp,
                    endtimestamp: timestamp,
                    result: (right * 10),
                }, success: function (data) {
                    var dat = JSON.parse(data);
                    //  console.log(dat)
                }
            })
            {#alert(endTime + "111");#}
            alert('本次测试正确个数：' + right + '，总题数：' + tinum);

        });
        //initiate dataTables plugin
        var myTable =
            $('#dynamic-table')
            //.wrap("<div class='dataTables_borderWrap' />")   //if you are applying horizontal scrolling (sScrollX)
                .DataTable({
                    bAutoWidth: false,
                    "aoColumns": [
                        {"bSortable": false},
                        null, null, null, null, null,
                        {"bSortable": false}
                    ],
                    "aaSorting": [],


                    //"bProcessing": true,
                    //"bServerSide": true,
                    //"sAjaxSource": "http://127.0.0.1/table.php"	,

                    //,
                    //"sScrollY": "200px",
                    //"bPaginate": false,

                    //"sScrollX": "100%",
                    //"sScrollXInner": "120%",
                    //"bScrollCollapse": true,
                    //Note: if you are applying horizontal scrolling (sScrollX) on a ".table-bordered"
                    //you may want to wrap the table inside a "div.dataTables_borderWrap" element

                    //"iDisplayLength": 50


                    select: {
                        style: 'multi'
                    }
                });


        $.fn.dataTable.Buttons.defaults.dom.container.className = 'dt-buttons btn-overlap btn-group btn-overlap';

        new $.fn.dataTable.Buttons(myTable, {
            buttons: [
                {
                    "extend": "colvis",
                    "text": "<i class='fa fa-search bigger-110 blue'></i> <span class='hidden'>Show/hide columns</span>",
                    "className": "btn btn-white btn-primary btn-bold",
                    columns: ':not(:first):not(:last)'
                },
                {
                    "extend": "copy",
                    "text": "<i class='fa fa-copy bigger-110 pink'></i> <span class='hidden'>Copy to clipboard</span>",
                    "className": "btn btn-white btn-primary btn-bold"
                },
                {
                    "extend": "csv",
                    "text": "<i class='fa fa-database bigger-110 orange'></i> <span class='hidden'>Export to CSV</span>",
                    "className": "btn btn-white btn-primary btn-bold"
                },
                {
                    "extend": "excel",
                    "text": "<i class='fa fa-file-excel-o bigger-110 green'></i> <span class='hidden'>Export to Excel</span>",
                    "className": "btn btn-white btn-primary btn-bold"
                },
                {
                    "extend": "pdf",
                    "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to PDF</span>",
                    "className": "btn btn-white btn-primary btn-bold"
                },
                {
                    "extend": "print",
                    "text": "<i class='fa fa-print bigger-110 grey'></i> <span class='hidden'>Print</span>",
                    "className": "btn btn-white btn-primary btn-bold",
                    autoPrint: false,
                    message: 'This print was produced using the Print button for DataTables'
                }
            ]
        });
        myTable.buttons().container().appendTo($('.tableTools-container'));

        //style the message box
        var defaultCopyAction = myTable.button(1).action();
        myTable.button(1).action(function (e, dt, button, config) {
            defaultCopyAction(e, dt, button, config);
            $('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white');
        });


        var defaultColvisAction = myTable.button(0).action();
        myTable.button(0).action(function (e, dt, button, config) {

            defaultColvisAction(e, dt, button, config);


            if ($('.dt-button-collection > .dropdown-menu').length == 0) {
                $('.dt-button-collection')
                    .wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />')
                    .find('a').attr('href', '#').wrap("<li />")
            }
            $('.dt-button-collection').appendTo('.tableTools-container .dt-buttons')
        });

        ////

        setTimeout(function () {
            $($('.tableTools-container')).find('a.dt-button').each(function () {
                var div = $(this).find(' > div').first();
                if (div.length == 1) div.tooltip({container: 'body', title: div.parent().text()});
                else $(this).tooltip({container: 'body', title: $(this).text()});
            });
        }, 500);


        myTable.on('select', function (e, dt, type, index) {
            if (type === 'row') {
                $(myTable.row(index).node()).find('input:checkbox').prop('checked', true);
            }
        });
        myTable.on('deselect', function (e, dt, type, index) {
            if (type === 'row') {
                $(myTable.row(index).node()).find('input:checkbox').prop('checked', false);
            }
        });


        /////////////////////////////////
        //table checkboxes
        $('th input[type=checkbox], td input[type=checkbox]').prop('checked', false);

        //select/deselect all rows according to table header checkbox
        $('#dynamic-table > thead > tr > th input[type=checkbox], #dynamic-table_wrapper input[type=checkbox]').eq(0).on('click', function () {
            var th_checked = this.checked;//checkbox inside "TH" table header

            $('#dynamic-table').find('tbody > tr').each(function () {
                var row = this;
                if (th_checked) myTable.row(row).select();
                else myTable.row(row).deselect();
            });
        });

        //select/deselect a row when the checkbox is checked/unchecked
        $('#dynamic-table').on('click', 'td input[type=checkbox]', function () {
            var row = $(this).closest('tr').get(0);
            if (this.checked) myTable.row(row).deselect();
            else myTable.row(row).select();
        });


        $(document).on('click', '#dynamic-table .dropdown-toggle', function (e) {
            e.stopImmediatePropagation();
            e.stopPropagation();
            e.preventDefault();
        });


        //And for the first simple table, which doesn't have TableTools or dataTables
        //select/deselect all rows according to table header checkbox
        var active_class = 'active';
        $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function () {
            var th_checked = this.checked;//checkbox inside "TH" table header

            $(this).closest('table').find('tbody > tr').each(function () {
                var row = this;
                if (th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
                else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
            });
        });

        //select/deselect a row when the checkbox is checked/unchecked
        $('#simple-table').on('click', 'td input[type=checkbox]', function () {
            var $row = $(this).closest('tr');
            if ($row.is('.detail-row ')) return;
            if (this.checked) $row.addClass(active_class);
            else $row.removeClass(active_class);
        });


        /********************************/
        //add tooltip for small view action buttons in dropdown menu
        $('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});

        //tooltip placement on right or left
        function tooltip_placement(context, source) {
            var $source = $(source);
            var $parent = $source.closest('table')
            var off1 = $parent.offset();
            var w1 = $parent.width();

            var off2 = $source.offset();
            //var w2 = $source.width();

            if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
            return 'left';
        }


        /***************/
        $('.show-details-btn').on('click', function (e) {
            e.preventDefault();
            $(this).closest('tr').next().toggleClass('open');
            $(this).find(ace.vars['.icon']).toggleClass('fa-angle-double-down').toggleClass('fa-angle-double-up');
        });
        /***************/


        /**
         //add horizontal scrollbars to a simple table
         $('#simple-table').css({'width':'2000px', 'max-width': 'none'}).wrap('<div style="width: 1000px;" />').parent().ace_scroll(
         {
           horizontal: true,
           styleClass: 'scroll-top scroll-dark scroll-visible',//show the scrollbars on top(default is bottom)
           size: 2000,
           mouseWheelLock: true
         }
         ).css('padding-top', '12px');
         */


    })
</script>
</body>
</html>
